﻿using System.Linq;
using UnityEngine;
using XNode;

namespace Gp.AI {
    [CreateAssetMenu(fileName = "New UnitAIBrain", menuName = "Gp/AI", order = 0)]
    public class UnitAIBrainPreset : NodeGraph {
        public StartAINodeEntry RootNode() {
            var root = nodes.FirstOrDefault(x => x is StartNode) as StartNode;
            if (root == null) return null;
            return root.NodeEntry() as StartAINodeEntry;
        }
    }
}